import java.util.Comparator;


public class AthleteComparator implements Comparator<Athlete>{
	public int compare (Athlete a1, Athlete a2){
		
		if (a1.getLastPassage()<a2.getLastPassage())
			return 1;
		
		if (a1.getLastPassage()>a2.getLastPassage())
			return -1;
		
		if (a1.currentTime()<a2.currentTime())
			return -1;
		
		if (a1.currentTime()>a2.currentTime())
			return 1;
		
		return 0;
	}
}
